package cz.muni.fi.pa165.dundd.dao;

import cz.muni.fi.pa165.dundd.entity.Hero;
import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * This class implements the data access object pattern for Hero entity which is
 * persisted in the database.
 *
 * @author xszanto1 <ardos@mail.muni.cz>
 */
@Repository
public interface HeroDAO {

    /**
     * Method persists the hero passed as parameter to the data source.
     *
     * @param hero
     */
    public void createHero(Hero hero);

    /**
     * Retrieves hero with given id (as parameter) from the data source.
     *
     * @param id of the hero being retrieved from the data source.
     * @return the hero with the given id from the database.
     */
    public Hero retrieveHero(Long id);

    /**
     * Retrieves all heroes persisted in the data source.
     *
     * @return list of heroes available in the database.
     */
    public List<Hero> retrieveAllHeroes();

    /**
     * Method updates the hero passed as parameter in the data source.
     *
     * @param hero
     */
    public void updateHero(Hero hero);

    /**
     * Method deletes the hero passed as parameter from the data source.
     *
     * @param hero
     */
    public void deleteHero(Hero hero);

    public Hero retrieveHero(String name);

}
